import request from "@/utils/request";
import store from "@/store";

export default {
  startExam(id, number, name, subjectName) {
    return request({
      url: `/subjectTest/insert/${name}/${id}/${number}/${subjectName}`,
      method: "put",
    });
  },
  batchGet(selfTestId) {
    return request({
      url: `/subjectTestRelationQuestion/batchGet/${selfTestId}`,
      method: "get",
    });
  },
  submit(score, subjectTestId, usedTime) {
    const date = new Date().getTime();
    return request({
      url: `/subjectTest/submit/${score}/${subjectTestId}/${usedTime}/${date}`,
      method: "put",
    });
  },
  getTestedCountAndScore(subjectId) {
    return request({
      url: `/subjectTest/getTestedCountAndScore/${subjectId}`,
      method: "get",
    });
  },
  // 获取已通过考试的列表
  getPassedList(params) {
    return request({
      url: '/subjectTest/getPassedList',
      method: 'get',
      params
    });
  },
  // 获取已通过考试的总数
  getPassedCount(params) {
    return request({
      url: '/subjectTest/getPassedCount',
      method: 'get',
      params
    });
  }
};
